<template>
	<view class="page index">
		<view class="header">
			<nav-bar title="活动日历">
			</nav-bar>
		</view>
		<view class="section clearFix">
			<view class="boxTop clearFix" :style="{height:boxTopHeight}">
				<view class="backgroundBlur"></view>
				<view class="askForLeave">
					<view class="top">
						<view class="top-brief">
							<text class="top-brief_certainly">必</text><text>“三会一课”活动</text>
						</view>
						<view class="top-style">
							<text class="top-style_dog">忠犬警队</text>
							<text class="top-style_moral">德育</text>
						</view>
					</view>
					<view class="centre">
						<view class="department1">
							<text>主办：</text>
							<text>XX部门</text>
						</view>
						<view class="department2">
							<text>时间：</text>
							<text>2023-02-01 12:00:00</text>
						</view>
						<view class="department3">
							<text>地点：</text>
							<text>织里镇公安分局</text>
						</view>
					</view>
					<!-- 120.271941,30.87562 -->
					<view class="bottomMap" ref="bottomMap">
						<map id="map" style="height: 220rpx;width: 800rpx;" name="myMap" :longitude="lon"
							:latitude="lat" :scale="17"></map>
					</view>
				</view>
			</view>
			<view class="signs">
				<button>签到</button><button>请假</button>
			</view>
			<view class="moveAbout">
				<view class="moveTop">
					<text>活动日历</text>
				</view>
				<view class="list">
					<view class="item" v-for="index in 2" :key="index">
						<view class="item-left">
							<text>忠诚</text>
							<image class="imgs" src="" />
							<view class="backColor">
								<text>德育</text>
							</view>
						</view>
						<view class="item-right">
							<view class="item-right_text">
								<text class="certainly">必</text><text>“三会一课”活动</text>
								<view class="centre">
									<view class="department1">
										<text>主办：</text>
										<text>XX部门</text>
									</view>
									<view class="department2">
										<text>时间：</text>
										<text>2023-02-01 12:00:00</text>
									</view>
									<view class="department3">
										<text>地点：</text>
										<text>织里镇公安分局</text>
									</view>
								</view>
							</view>
							<view class="item-right_but">
								<button>请假</button>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		data() {
			return {
				lon: 120.271941,
				lat: 30.87562,
				boxTopHeight: 0,
				headerHeight: 0,
			}
		},
		created() {
			// uni.getLocation({
			// 	success: (res) => {
			// 		this.lon = res.longitude;
			// 		this.lat = res.latitude;
			// 		// console.log('当前位置的经度：' + res.longitude);
			// 		// console.log('当前位置的纬度：' + res.latitude);
			// 	}
			// });
			// uni.chooseLocation({
			// 	success: function(res) {
			// 		console.log('位置名称：' + res.name);
			// 		console.log('详细地址：' + res.address);
			// 		console.log('纬度：' + res.latitude);
			// 		console.log('经度：' + res.longitude);
			// 	}
			// });
			this.$nextTick(() => {
				uni.createSelectorQuery().select('.askForLeave').boundingClientRect(data => {
					if (data.height) {
						this.boxTopHeight = data.height + 20
					} else {
						this.boxTopHeight = 280
					}
					console.log(data.height)
				}).exec();
			})
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/common/style/common.scss";
	@import 'index.scss';
</style>